using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("ClubSeasons")]
	[Serializable]
    public class ClubSeason : DBO<ClubSeason>
    {
		#region Fields
		
		private int? _IdClubSeasons;
		private int? _IdClub;
		private int? _IdSeason;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public ClubSeason()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdClubSeasons 
		/// </summary>
		/// <param name="IdClubSeasons">The IdClubSeasons</param>
		public ClubSeason(int? IdClubSeasons )
		{
			this.IdClubSeasons = IdClubSeasons;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdClubSeasons">Sets int? value for IdClubSeasons</param>
		/// <param name="IdClub">Sets int? value for IdClub</param>
		/// <param name="IdSeason">Sets int? value for IdSeason</param>
		public ClubSeason(int? idClubSeasons, int? idClub, int? idSeason)
		{
			this.IdClubSeasons = idClubSeasons;
			this.IdClub = idClub;
			this.IdSeason = idSeason;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdClubSeasons
		/// </summary>
		[ColumnAttribute("IdClubSeasons", SqlDbType.Int , 4 , true, true, false)]
		public int? IdClubSeasons
		{
			set
			{
				this._IdClubSeasons = value;
			}
			get
			{
				return this._IdClubSeasons;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdClub
		/// </summary>
		[ColumnAttribute("IdClub", SqlDbType.Int , 4 , false, false, true)]
		public int? IdClub
		{
			set
			{
				this._IdClub = value;
			}
			get
			{
				return this._IdClub;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdSeason
		/// </summary>
		[ColumnAttribute("IdSeason", SqlDbType.Int , 4 , false, false, true)]
		public int? IdSeason
		{
			set
			{
				this._IdSeason = value;
			}
			get
			{
				return this._IdSeason;
			}
		}
		
		
		/// <summary>
		/// Get a Club of current ClubSeason object base on IdClub
		/// </summary>
		public Club Club
		{
			get
			{
				if (this.IdClub == null)
					return null;
	
				Club condition = new Club(this.IdClub);
				return ClubController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a Season of current ClubSeason object base on IdSeason
		/// </summary>
		public Season Season
		{
			get
			{
				if (this.IdSeason == null)
					return null;
	
				Season condition = new Season(this.IdSeason);
				return SeasonController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdClubSeasons]
            /// </summary>
            public string IdClubSeasons
            {
                get
                {
                    return "IdClubSeasons";
                }
            }
            /// <summary>
            /// Get the name of column [IdClub]
            /// </summary>
            public string IdClub
            {
                get
                {
                    return "IdClub";
                }
            }
            /// <summary>
            /// Get the name of column [IdSeason]
            /// </summary>
            public string IdSeason
            {
                get
                {
                    return "IdSeason";
                }
            }
        }
        #endregion
    }
}
